/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * A single offer for a one-time product.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OneTimeProductOffer extends com.google.api.client.json.GenericJson {

  /**
   * A discounted offer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductDiscountedOffer discountedOffer;

  /**
   * Required. Immutable. The ID of this product offer. Must be unique within the purchase option.
   * It must start with a number or lower-case letter, and can only contain lower-case letters
   * (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String offerId;

  /**
   * Optional. List of up to 20 custom tags specified for this offer, and returned to the app
   * through the billing library.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OfferTag> offerTags;

  static {
    // hack to force ProGuard to consider OfferTag used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(OfferTag.class);
  }

  /**
   * Required. Immutable. The package name of the app the parent product belongs to.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String packageName;

  /**
   * A pre-order offer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductPreOrderOffer preOrderOffer;

  /**
   * Required. Immutable. The ID of the parent product this offer belongs to.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String productId;

  /**
   * Required. Immutable. The ID of the purchase option to which this offer is an extension.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String purchaseOptionId;

  /**
   * Set of regional pricing and availability information for this offer. Must not have duplicate
   * entries with the same region_code.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OneTimeProductOfferRegionalPricingAndAvailabilityConfig> regionalPricingAndAvailabilityConfigs;

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product offer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private RegionsVersion regionsVersion;

  /**
   * Output only. The current state of this offer. This field cannot be changed by updating the
   * resource. Use the dedicated endpoints instead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String state;

  /**
   * A discounted offer.
   * @return value or {@code null} for none
   */
  public OneTimeProductDiscountedOffer getDiscountedOffer() {
    return discountedOffer;
  }

  /**
   * A discounted offer.
   * @param discountedOffer discountedOffer or {@code null} for none
   */
  public OneTimeProductOffer setDiscountedOffer(OneTimeProductDiscountedOffer discountedOffer) {
    this.discountedOffer = discountedOffer;
    return this;
  }

  /**
   * Required. Immutable. The ID of this product offer. Must be unique within the purchase option.
   * It must start with a number or lower-case letter, and can only contain lower-case letters
   * (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * @return value or {@code null} for none
   */
  public java.lang.String getOfferId() {
    return offerId;
  }

  /**
   * Required. Immutable. The ID of this product offer. Must be unique within the purchase option.
   * It must start with a number or lower-case letter, and can only contain lower-case letters
   * (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
   * @param offerId offerId or {@code null} for none
   */
  public OneTimeProductOffer setOfferId(java.lang.String offerId) {
    this.offerId = offerId;
    return this;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this offer, and returned to the app
   * through the billing library.
   * @return value or {@code null} for none
   */
  public java.util.List<OfferTag> getOfferTags() {
    return offerTags;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this offer, and returned to the app
   * through the billing library.
   * @param offerTags offerTags or {@code null} for none
   */
  public OneTimeProductOffer setOfferTags(java.util.List<OfferTag> offerTags) {
    this.offerTags = offerTags;
    return this;
  }

  /**
   * Required. Immutable. The package name of the app the parent product belongs to.
   * @return value or {@code null} for none
   */
  public java.lang.String getPackageName() {
    return packageName;
  }

  /**
   * Required. Immutable. The package name of the app the parent product belongs to.
   * @param packageName packageName or {@code null} for none
   */
  public OneTimeProductOffer setPackageName(java.lang.String packageName) {
    this.packageName = packageName;
    return this;
  }

  /**
   * A pre-order offer.
   * @return value or {@code null} for none
   */
  public OneTimeProductPreOrderOffer getPreOrderOffer() {
    return preOrderOffer;
  }

  /**
   * A pre-order offer.
   * @param preOrderOffer preOrderOffer or {@code null} for none
   */
  public OneTimeProductOffer setPreOrderOffer(OneTimeProductPreOrderOffer preOrderOffer) {
    this.preOrderOffer = preOrderOffer;
    return this;
  }

  /**
   * Required. Immutable. The ID of the parent product this offer belongs to.
   * @return value or {@code null} for none
   */
  public java.lang.String getProductId() {
    return productId;
  }

  /**
   * Required. Immutable. The ID of the parent product this offer belongs to.
   * @param productId productId or {@code null} for none
   */
  public OneTimeProductOffer setProductId(java.lang.String productId) {
    this.productId = productId;
    return this;
  }

  /**
   * Required. Immutable. The ID of the purchase option to which this offer is an extension.
   * @return value or {@code null} for none
   */
  public java.lang.String getPurchaseOptionId() {
    return purchaseOptionId;
  }

  /**
   * Required. Immutable. The ID of the purchase option to which this offer is an extension.
   * @param purchaseOptionId purchaseOptionId or {@code null} for none
   */
  public OneTimeProductOffer setPurchaseOptionId(java.lang.String purchaseOptionId) {
    this.purchaseOptionId = purchaseOptionId;
    return this;
  }

  /**
   * Set of regional pricing and availability information for this offer. Must not have duplicate
   * entries with the same region_code.
   * @return value or {@code null} for none
   */
  public java.util.List<OneTimeProductOfferRegionalPricingAndAvailabilityConfig> getRegionalPricingAndAvailabilityConfigs() {
    return regionalPricingAndAvailabilityConfigs;
  }

  /**
   * Set of regional pricing and availability information for this offer. Must not have duplicate
   * entries with the same region_code.
   * @param regionalPricingAndAvailabilityConfigs regionalPricingAndAvailabilityConfigs or {@code null} for none
   */
  public OneTimeProductOffer setRegionalPricingAndAvailabilityConfigs(java.util.List<OneTimeProductOfferRegionalPricingAndAvailabilityConfig> regionalPricingAndAvailabilityConfigs) {
    this.regionalPricingAndAvailabilityConfigs = regionalPricingAndAvailabilityConfigs;
    return this;
  }

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product offer.
   * @return value or {@code null} for none
   */
  public RegionsVersion getRegionsVersion() {
    return regionsVersion;
  }

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product offer.
   * @param regionsVersion regionsVersion or {@code null} for none
   */
  public OneTimeProductOffer setRegionsVersion(RegionsVersion regionsVersion) {
    this.regionsVersion = regionsVersion;
    return this;
  }

  /**
   * Output only. The current state of this offer. This field cannot be changed by updating the
   * resource. Use the dedicated endpoints instead.
   * @return value or {@code null} for none
   */
  public java.lang.String getState() {
    return state;
  }

  /**
   * Output only. The current state of this offer. This field cannot be changed by updating the
   * resource. Use the dedicated endpoints instead.
   * @param state state or {@code null} for none
   */
  public OneTimeProductOffer setState(java.lang.String state) {
    this.state = state;
    return this;
  }

  @Override
  public OneTimeProductOffer set(String fieldName, Object value) {
    return (OneTimeProductOffer) super.set(fieldName, value);
  }

  @Override
  public OneTimeProductOffer clone() {
    return (OneTimeProductOffer) super.clone();
  }

}
